package com.xinqi.modules.course.course.enums;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.xinqi.common.base.enums.BaseEnum;
import lombok.Getter;

/**
 * 课程归档状态枚举
 *
 * @author wenjie
 * @date 2023/3/8  17:29
 */
public enum CourseArchiveStatusEnum {

    NORMAL("NORMAL", "正常"),

    /**
     * 对于课程来说，这个字段没啥用
     */
    ARCHIVE_SELF("ARCHIVE_SELF", "归档自己"),

    ARCHIVE_ALL("ARCHIVE_ALL", "归档全班");

    @Getter(onMethod_ = {@JsonValue})
    private final String code;

    @Getter
    private final String describe;

    CourseArchiveStatusEnum(String code, String describe) {
        this.code = code;
        this.describe = describe;
    }

    @JsonCreator
    public static CourseArchiveStatusEnum of(String code) {
        return BaseEnum.of(CourseArchiveStatusEnum.class, code);
    }
}
